<template>
  <div>
    <div class="container">
      <router-view @toparent="getTitle"></router-view>
    </div>
    <van-tabbar
      v-model="active"
      style="background:#222"
      active-color="#fff"
      inactive-color="#4d4d4d"
    >
      <van-tabbar-item icon="home-o" to="home">首页</van-tabbar-item>
      <van-tabbar-item icon="bars" to="classify">分类</van-tabbar-item>

      <van-tabbar-item icon="shopping-cart-o" to="recommend">推荐</van-tabbar-item>
      <van-tabbar-item icon="contact" to="my">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  name: "Index",
  data() {
    return {
      active: 0
    };
  },
  methods: {
    getTitle(msg) {
      this.title = msg;
    }
  }
};
</script>

<style  scoped>
.container {
  padding-bottom: 50px;
}
</style>